<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp" %>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="微社区,Q生活" name="keywords"/>
<meta content="微社区,Q生活" name="description"/>
<title>微社区|Q生活</title>
<link rel="stylesheet" href="${ctx }/static/css/Master.css"/>
<link rel="stylesheet" href="${ctx }/static/css/lq.datetimepick.css"/>

<script src="${ctx }/static/js/jquery-1.9.0.min.js"></script>
<script src="${ctx }/static/js/simpletooltip.min.js"></script>
<script src="${ctx }/static/js/selectUi.js"></script>

<script src="${ctx}/static/plugins/layer/layer.js"></script>
<%-- 基础js,所有页面都需要引入此js,依赖layer.js --%>
<script src="${ctx}/static/js/common/base.js"></script>
<script src="${ctx}/static/js/common/util.js"></script>
<script type="text/javascript">
//删除
function del(id,name) {
	top.layer.confirm('确认删除"'+name+'"吗?', {icon: 3}, function(index){
		$.ajax({    
		    url:"${ctx}/dictionary/"+id+"/delete",   
		    data:"",    
		    type:"get",    
		    cache:false,    
		    dataType:"json",
		    async:true, //默认为true 异步    
		    success:function(data) {    
	            top.layer.msg(data,{},function(){
		        	window.location.reload();   
				});
		     }  
		});
	});
    
}
</script>
</head>

<body class="utilSubmit">
<section class="boxRight">
<form id="searchForm" method="get" >
	<div class="context boxborder">
	
		<!-- 查询 -->
		<div class="SearchList">
			<ul class="clearfix">
				<li><span class="name">类型名称：</span><span class="pt"><input type="text" id="typeName" name="typeName" value="${result.entity.typeName }" /></span></li>
				<li><span class="name">类型编码：</span><span class="pt"><input type="text" id="type" name="type" value="${result.entity.type }"/></span></li>
				<li><span class="name">内容：</span><span class="pt"><input type="text" name="content" value="${result.entity.content }"/></span></li>
				<li><span class="name">内容编码：</span><span class="pt"><input type="text" id="code" name="code" value="${result.entity.code }"/></span></li>
				<li class="combtn pr"><a href="javascript:void(0);" onclick="submitPage(1,this);" class="utilSubmitBtn">查询</a><a href="javascript:void(0);" class="utilReset">重置</a> </li>
			</ul>
		</div>
		
		<!-- 顶部按钮 -->
		<shiro:hasPermission name="sys:dictionary:create">
		<div class="pr prlink"><a href="${ctx}/dictionary/create"><span class="icon j_icon"></span>新增数据字典</a></div>
		</shiro:hasPermission>
		
		<!-- 内容 -->
		<div class="com_table">
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<th>序号</th>
					<th>类型名称</th>
					<th>类型编码</th>
					<th>内容</th>
					<th>内容编码</th>
					<th>显示顺序</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
				<c:forEach items="${result.entityList}" var="dictionary" varStatus="status">
				<tr>
					<td>${(result.currentPage-1)*result.pageSize+status.count}</td>
					<td>${dictionary.typeName}</td>
					<td>${dictionary.type}</td>
					<td>${dictionary.content}</td>
					<td>${dictionary.code}</td>
					<td>${dictionary.showIndex}</td>
					<td>
						<div class="utilTips">
							<pretty:prettyTime date="${dictionary.insertDate}"/>
	                		<div class="utilTipsText" style="display: none;"><fmt:formatDate value="${dictionary.insertDate}" pattern="yyyy-MM-dd HH:mm:ss" /></div>
						</div>
					</td>
					<td>
						<shiro:hasPermission name="sys:dictionary:view">
							<a class="icon micon_9" title="详情" href="${ctx}/dictionary/${dictionary.id}/detail"></a>
						</shiro:hasPermission>
						
						<shiro:hasPermission name="sys:dictionary:update">
                        	<a class="icon micon_2" title="编辑" href="${ctx}/dictionary/${dictionary.id}/update"></a>
	                    </shiro:hasPermission>
	                    
	                    <shiro:hasPermission name="sys:dictionary:delete">
	                       <a class="icon micon_20" title="删除" href="javascript:void(0);" onclick="del('${dictionary.id}','${dictionary.content }');" ></a>
	                    </shiro:hasPermission>
					</td>
				</tr>
				</c:forEach>
			</table>
			<%-- 分页 --%>
			<%@ include file="/WEB-INF/common/page.jsp"%>
		</div>
	</div>
</form>
</section>
</body>
</html>
